package com.bcbim.authentication_interface.role.service;

import com.bcbim.authentication_interface.ability.dao.RoleAbilityDAO;
import com.bcbim.authentication_interface.role.dao.RoleMenuDAO;
import com.bcbim.authentication_interface.role.dto.RoleMenuAbilityDTO;
import com.bcbim.authentication_interface.role.vo.MenuAbilityVO;
import com.bcbim.common.sys.Code;

import java.util.List;

/**
 * @Description: 角色权限接口
 * @Author: ye
 * @Date: 2021/7/6
 * @Version: V1.0
 **/
public interface RoleAuthenticationService {

    /**
     * @Description: 获取所有菜单
     * @Param: applicationPlatform
     * @Return: List<MenuAbilityVO>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<MenuAbilityVO> getAllMenuByApplication(String applicationPlatform);

    /**
     * @Description: 获取所有功能
     * @Param: applicationPlatform
     * @Return: List<MenuAbilityVO>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<MenuAbilityVO> getAllAbilityByApplication(String applicationPlatform);

    /**
     * @Description: 查询角色
     * @Param: roleName
     * @Return: List<Code>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<Code> selectRole(String roleName);

    /**
     * @Description: 获取角色拥有菜单权限
     * @Param: RoleMenuAbilityQuery
     * @Return: List<String>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<String> getRoleMenuAuthentication(RoleMenuAbilityDTO query);

    /**
     * @Description: 获取角色拥有功能权限
     * @Param: RoleMenuAbilityQuery
     * @Return: List<String>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<String> getRoleAbilityAuthentication(RoleMenuAbilityDTO query);

    /**
     * @Description: 获取对应的三级页面id
     * @Param: levelTwoId
     * @Return: List<String>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<String> getLevelThreeMenu(String levelTwoId);

    /**
     * @Description: 根据页面id获取功能
     * @Param: List<String> 页面id
     * @Return: List<String>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<String> getAbilityByMenuId(List<String> childrenPage);

    /**
     * @Description: 清空用户权限
     * @Param: roleId
     * @Param: arrayMenuId
     * @Param: arrayAbilityId
     * @Return:
     * @Author: ye
     * @Date: 2021/7/7
     */
    void clearRoleAuthentication(String roleId, List<String> arrayMenuId, List<String> arrayAbilityId);

    /**
     * @Description: 区分页面
     * @Param: String[] checkId
     * @Return: List<String>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<String> distinguishMenu(String[] checkId);

    /**
     * @Description: 区分功能
     * @Param: String[] checkId
     * @Return: List<String>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<String> distinguishAbility(String[] checkId);

    /**
     * @Description: 保存角色权限
     * @Param: List<RoleMenuDO>
     * @Param: List<RoleAbilityDO>
     * @Return:
     * @Author: ye
     * @Date: 2021/7/7
     */
    void saveRoleAuthentication(List<RoleMenuDAO> roleMenuList, List<RoleAbilityDAO> roleAbilityList);

    /**
     * @Description: 查询根节点
     * @Param: levelTwoId
     * @Return: String
     * @Author: ye
     * @Date: 2021/7/7
     */
    String getMenuRootId(String levelTwoId);

    /**
     * @Description: 获取二级菜单数量
     * @Param: roleId
     * @Param: rootId
     * @Return: int
     * @Author: ye
     * @Date: 2021/7/7
     */
    int countRoleLevelTwoMenu(String roleId, String rootId);
}
